-
Notifications
You must be signed in to change notification settings - Fork 9
Metrics in logs - Assembler #292
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
be90f40 to
56d720e
Compare
56d720e to
4aa4e3d
Compare
8612078 to
58e032d
Compare
7f9b131 to
5065ea1
Compare
633acae to
5bebcab
Compare
5bebcab to
e0ef3e2
Compare
6807b2e to
60cc424
Compare
60cc424 to
392db26
Compare
392db26 to
61f1d7f
Compare
839e81b to
5a1178b
Compare
5a1178b to
000c7b2
Compare
node/ledger/assembler_ledger.go
Outdated
| func (l *AssemblerLedger) GetTxCount() uint64 { | ||
| c := atomic.LoadUint64(&l.transactionCount) | ||
| return c | ||
| func (l *AssemblerLedger) GetBlocksCount() uint64 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
block count is the height, why do we need another method?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The assembler_role contains the ledger that implements the AssemblerLedgerWrite interface, which does not expose the height.
c84e482 to
018df9c
Compare
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
node/assembler/assembler_metrics.go
Outdated
| } | ||
|
|
||
| func (m *Metrics) trackMetrics() { | ||
| lastTxCommitted, lastBlocksCommitted := uint64(0), uint64(0) |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
node/assembler/assembler_metrics.go
Outdated
| blocksCommitted := atomic.LoadUint64(&m.ledgerMetrics.BlocksCount) | ||
| blocksSizeCommitted := atomic.LoadUint64(&m.ledgerMetrics.BlocksSize) | ||
|
|
||
| m.logger.Infof("ASSEMBLER_METRICS: total committed transactions %d, new transactions in the last %.2f seconds: %d, total blocks: %d, new blocks in the last: %.2f seconds: %d, total size: %d, prefetch buffer size: %d(%s) bytes", |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
node/ledger/assembler_ledger.go
Outdated
| return NewAssemblerLedger(logger, ledgerPath) | ||
| } | ||
|
|
||
| type AssemblerLedgerMetrics struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Put it in a new file, it will be the prometheus metrics in the next PR, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
right
| return nil, fmt.Errorf("error while fetching last block from ledger %w", err) | ||
| } | ||
| _, _, transactionCount, err = AssemblerBatchIdOrderingInfoAndTxCountFromBlock(block) | ||
| _, _, alm.TransactionCount, err = AssemblerBatchIdOrderingInfoAndTxCountFromBlock(block) |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
| if err := l.Ledger.Append(configBlock); err != nil { | ||
| panic(err) | ||
| } | ||
| atomic.AddUint64(&l.metrics.BlocksCount, uint64(1)) |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
| metrics PartitionPrefetchIndexMetrics | ||
| } | ||
|
|
||
| type PartitionPrefetchIndexMetrics [2]*uint64 |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
018df9c to
10ae0f3
Compare
Signed-off-by: Genady Gurevich <[email protected]>
10ae0f3 to
7cde6d0
Compare
issue: #263